package com.education.wisdom.service.impl;

import java.util.List;

import com.education.common.utils.Convert;
import com.education.wisdom.mapper.JrSchoolCatalogMapper;
import com.education.wisdom.pojo.JrSchoolCatalog;
import com.education.wisdom.service.IJrSchoolCatalogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 学校购买课程 服务层实现
 *
 * @author d
 * @date 2020-08-10
 */
@Service
public class JrSchoolCatalogServiceImpl implements IJrSchoolCatalogService {

    @Autowired
    private JrSchoolCatalogMapper jrSchoolCatalogMapper;

    /**
     * 查询学校购买课程信息
     *
     * @param schoolId 学校购买课程ID
     * @return 学校购买课程信息
     */
    @Override
    public List<Integer> selectJrSchoolCatalogBySchoolId(Integer schoolId) {
        return jrSchoolCatalogMapper.selectJrSchoolCatalogBySchoolId(schoolId);
    }

    /**
     * 查询学校购买课程信息
     *
     * @param schoolId 学校购买课程ID
     * @return 学校购买课程信息
     */
    @Override
    public JrSchoolCatalog selectJrSchoolCatalogById(Integer schoolId) {
        return jrSchoolCatalogMapper.selectJrSchoolCatalogById(schoolId);
    }

    /**
     * 查询学校购买课程列表
     *
     * @param jrSchoolCatalog 学校购买课程信息
     * @return 学校购买课程集合
     */
    @Override
    public List<JrSchoolCatalog> selectJrSchoolCatalogList(JrSchoolCatalog jrSchoolCatalog) {
        return jrSchoolCatalogMapper.selectJrSchoolCatalogList(jrSchoolCatalog);
    }

    /**
     * 新增学校购买课程
     *
     * @param jrSchoolCatalog 学校购买课程信息
     * @return 结果
     */
    @Override
    public int insertJrSchoolCatalog(JrSchoolCatalog jrSchoolCatalog) {
        return jrSchoolCatalogMapper.insertJrSchoolCatalog(jrSchoolCatalog);
    }

    /**
     * 修改学校购买课程
     *
     * @param jrSchoolCatalog 学校购买课程信息
     * @return 结果
     */
    @Override
    public int updateJrSchoolCatalog(JrSchoolCatalog jrSchoolCatalog) {
        return jrSchoolCatalogMapper.updateJrSchoolCatalog(jrSchoolCatalog);
    }

    /**
     * 删除学校购买课程对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteJrSchoolCatalogByIds(String ids) {
        return jrSchoolCatalogMapper.deleteJrSchoolCatalogByIds(Convert.toStrArray(ids));
    }
}